package com.mald.plugin.http.client;

import com.mald.plugin.util.HttpClientUtil;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;

import java.io.IOException;

/**
 * HttpClint常用方法
 * 不使用httpclient连接池，在每次调用完毕后均会释放链接
 *
 * @author
 * @since 2018/3/12
 */
public class HttpCommonClient extends HttpClientUtil {
    @Override
    public CloseableHttpClient getHttpClient() {
        return HttpClients.createDefault();
    }

    @Override
    public void releaseConnection(CloseableHttpClient httpClient) throws IOException {
        httpClient.close();
    }
}
